package com.mq.mqserver.Mapper;

import com.mq.mqserver.core.Binding;
import com.mq.mqserver.core.Exchange;
import com.mq.mqserver.core.MSGQueue;
import org.apache.ibatis.annotations.Mapper;


import java.util.List;

@Mapper
public interface MetaMapper {

    //三个核心文件的创建
    void createExchangeTable();
    void createQueueTable();
    void createBindingTable();

    //插入三个表
    void insertExchange(Exchange exchange);
    void insertBinding(Binding binding);
    void insertQueue(MSGQueue msgQueue);

    //删除三个表
    //name主键
    void deleteExchange(String exchangeName);
    //name主键
    void deleteQueue(String queueName);

    //没有主键，需要针对exchangeName和queueName两个维度筛选
    void deleteBinging(Binding binding);

    //查询三个表
    List<Exchange> selectAllExchanges();
    List<MSGQueue> selectAllQueues();
    List<Binding> selectAllBindings();

}
